package ro.gateway.aida.utils;

import ro.gateway.aida.obj.Category;
import ro.gateway.aida.struts.form.EditCategoryForm;



/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: :D application</p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: Romania Development Gateway </p>
 * @author Mihai.Popoaeiintellisource.ro
 * @version 1.0-* @version $Id: Patches.java,v 1.1 2004/10/24 23:37:20 mihaipostelnicu Exp $
 * @deprecated
 */
public class Patches
{

      public static EditCategoryForm to_categoryForm(
            Category cat, String lang )
      {
            EditCategoryForm result = new EditCategoryForm();
            result.setId( cat.getId() );
            result.setName( cat.getName().getString( lang ) );

            return result;
      }

      public static EditCategoryForm[] to_categoryForms(
            Category[] cats, String lang )
      {
            if ( cats == null || cats.length < 1 )
            {
                  return null;
            }

            EditCategoryForm[] result = new EditCategoryForm[ cats.length ];
            for ( int i = 0; i < cats.length; i++ )
            {
                  result[ i ] = to_categoryForm( cats[ i ], lang );
            }

            return result;
      }
}
